class Animal:
  def __init__(self):
    print('Animal init')

class Bird(Animal):
  def __init__(self, hungry):
    super().__init__()
    self.hungry = hungry
  def eat(self):
    if self.hungry:
      print('我饿了')
    else:
      print('我吃饱了')

bird_1 = Bird(False)
bird_1.eat()
# 我吃饱了

bird_2 = Bird(True)
bird_2.eat()
# 我饿了

class SongBird(Bird):
  def __init__(self, hungry):
    super().__init__(hungry)
    self.song = '我唱的歌'
  def sing(self):
    print(self.song)

songbird_1 = SongBird(True)
songbird_1.eat()
# 我饿了
songbird_1.sing()
# 我唱的歌
